package com.base_data_handler.utils.ftp;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class FtpConfig {
	 private static Logger logger = Logger.getLogger(FtpConfig.class);  
	  
	//主机ip
	public static String FtpHost = "";
	//端口号
	public static int FtpPort;
	//ftp用户名
	public static String FtpUser = "";
	//ftp密码
	public static String FtpPassword = "";
	//ftp中的目录
	private String FtpPath = "";
	
	  
	 static {  
	        try {  
	        	 InputStream in = FtpUtil.class.getClassLoader()  
		                    .getResourceAsStream("jdbc.properties");  
		            if (in == null) {  
		                logger.info("配置文件env.properties读取失败");  
		            } else {  
			        	Properties properties = new Properties(); 
			            properties.load(in);  
			            FtpUser = properties.getProperty("ftp.user_name");  
			            FtpPassword = properties.getProperty("ftp.user_pass");  
		                FtpHost = properties.getProperty("ftp.host");  
		                FtpPort = Integer.valueOf(properties.getProperty("ftp.port"))  
		                        .intValue();  
	                }
	        } catch (IOException e) {  
	            e.printStackTrace();  
	        }  
	    }  
	
	public String getFtpHost() {
		return FtpHost;
	}
	public void setFtpHost(String ftpHost) {
		FtpHost = ftpHost;
	}
	public int getFtpPort() {
		return FtpPort;
	}
	public void setFtpPort(int ftpPort) {
		FtpPort = ftpPort;
	}
	public String getFtpUser() {
		return FtpUser;
	}
	public void setFtpUser(String ftpUser) {
		FtpUser = ftpUser;
	}
	public String getFtpPassword() {
		return FtpPassword;
	}
	public void setFtpPassword(String ftpPassword) {
		FtpPassword = ftpPassword;
	}
	public String getFtpPath() {
		return FtpPath;
	}
	public void setFtpPath(String ftpPath) {
		FtpPath = ftpPath;
	}
	
	
	
}
